import com.opencloud.generator.server.service.GenerateConfig;
import com.opencloud.generator.server.service.GeneratorService;

import java.io.File;

public class GeneratorMain {

    public static void main(String[] args) {
        String outputDir = System.getProperty("user.dir") + File.separator + "generator";
        GenerateConfig config = new GenerateConfig();
        config.setJdbcUrl("jdbc:mysql://localhost:3306/dawn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC");
        config.setJdbcUserName("root");
        config.setJdbcPassword("root");
        config.setJdbcDriver("com.mysql.cj.jdbc.Driver");
//        config.setJdbcUrl("jdbc:oracle:thin:@192.168.100.109:1521:orcl");
//        config.setJdbcUserName("dawn");
//        config.setJdbcPassword("orcl");
//        config.setJdbcDriver("oracle.jdbc.driver.OracleDriver");
        config.setAuthor("rianbow");
        config.setParentPackage("com.gdtopway.dawn");
        config.setModuleName("base");
        config.setIncludeTables(new String[]{"CORE_ORG","CORE_USER","CORE_ROLE","CORE_RESOURCES","CORE_ORG_USER","CORE_USER_DATA_PERMISSION","CORE_USER_ROLE","CORE_ROLE_RESOURCES","CORE_ORG_LABEL"});
        config.setTablePrefix(new String[]{"CORE_"});
        config.setOutputDir(outputDir);
        GeneratorService.execute(config);
    }

}
